package C.e.string;

/**
 * String和StringBuilder的对比
 */
public class StringStringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder q=new StringBuilder("w");
        for (int i = 0; i < 9999999; i++) {
            q.append(i);
        }
        System.out.println("呀屎拉你");


















        /* StringBuilder s=new StringBuilder("a");
        for (int i = 0; i < 10000000; i++) {//1000万次
            s.append(i);
        }





       /* //String不适合频繁修改内容（效率低）
        String s="a";
        for (int i = 0; i < 10000000; i++) {//1000万次
            s=s+i;
        }//每次修改都会在内存中分配新的对象
            System.out.println("继续执行");*/

    }
}
